import request from '@/utils/request'

// 获取科普文章列表
export function getScienceList(params) {
  return request({
    url: '/admin/article/list',
    method: 'get',
    params
  })
}

// 创建科普文章
export function createScience(data) {
  return request({
    url: '/admin/article/create',
    method: 'post',
    data
  })
}

// 更新科普文章
export function updateScience(data) {
  return request({
    url: `/admin/article/update/${data.id}`,
    method: 'put',
    data
  })
}

// 删除科普文章
export function deleteScience(id) {
  return request({
    url: `/admin/article/delete/${id}`,
    method: 'delete'
  })
}

// 获取科普文章详情
export function getScienceDetail(id) {
  return request({
    url: `/admin/article/${id}`,
    method: 'get'
  })
}

// 更新文章状态
export function updateScienceStatus(id, status) {
  return request({
    url: `/admin/article/status/${id}`,
    method: 'put',
    params: { status }
  })
} 